HandleControlKey
NEW WITH THE APPEARANCE MANAGER
Sends a keyboard event to a control with keyboard focus.
pascal SInt16 HandleControlKey ( ControlHandle inControl, SInt16 inKeyCode, SInt16 inCharCode, SInt16 inModifiers);
inControl
- On input, a handle to the control that currently has keyboard focus.
inKeyCode
- The virtual key code, derived from the event structure. This value represents the key pressed or released by the user. It is always the same for a specific physical key on a particular keyboard regardless of which modifier keys were also pressed.
inCharCode
- A particular character, derived from the event structure. The value that is generated depends on the virtual key code, the state of the modifier keys, and the current
'KCHR'
resource.inModifiers
- A constant from the
modifiers
field of the event structure specifying the state of the modifier keys and the mouse button at the time the event was posted.- function result
- Returns the part code that was hit during the keyboard event; see "Control Part Code Constants".
DISCUSSION
If you have determined that a keyboard event has occurred in a given window, before calling theHandleControlKey
function, callGetKeyboardFocus
to get the handle to the control that currently has keyboard focus. TheHandleControlKey
function passes the values specified in itsinKeyCode
,inCharCode
, andinModifiers
parameters to control definition functions that set thekControlSupportsFocus
feature bit.SEE ALSO
"Appearance Manager Gestalt Selector Constants".